<template>
  <div class="app-container">
    <div class="filter-container">
      <span class="filter-title filter-item">任务类型</span>
      <k-select
        v-model="listQuery.taskType"
        class="filter-item user-status"
        type="1"
        :custom-params="{opations:taskTypeList, label:'lineName',value:'lineId'}"
        @handleSelectEvent="handleFilter"
      />
      <span class="filter-title filter-item">参与方式</span>
      <k-select
        v-model="listQuery.partType"
        class="filter-item user-status"
        type="1"
        :custom-params="{opations:partTypeList, label:'lineName',value:'lineId'}"
        @handleSelectEvent="handleFilter"
      />
      <span class="filter-title filter-item">任务周期</span>
      <k-select
        v-model="listQuery.taskCycle"
        class="filter-item user-status"
        type="1"
        :custom-params="{opations:cycleTypeList, label:'lineName',value:'lineId'}"
        @handleSelectEvent="handleFilter"
      />
      <span class="filter-title filter-item">任务状态</span>
      <k-select
        v-model="listQuery.taskStatus"
        class="filter-item user-status"
        type="1"
        :select-params="[{label:'进行中',value: 1},{label:'未开始',value: 2},{label:'已结束',value: 3}]"
        @handleSelectEvent="handleFilter"
      />
      <span class="filter-title filter-item">任务时间</span>
      <k-date-picker
        v-model="timeValue"
        class="filter-item"
      />
      <k-select
        v-model="listQuery.timeNum"
        class="filter-item weekselect"
        type="1"
        :select-params="[{label:'周一',value: 1},{label:'周二',value: 2},{label:'周三',value: 3},{label:'周四',value: 4},{label:'周五',value: 5},{label:'周六',value: 6},{label:'周日',value: 7}]"
        @handleSelectEvent="handleFilter"
      />
      <k-input
        v-model.trim="listQuery.key"
        class="filter-item"
        is-search
        placeholder="请输入关键词"
        :search-fun="handleFilter"
        @keyup.enter.native="handleFilter"
      />
    </div>
    <!-- 创建 roll 房 -->
    <div class="op_container">
      <k-button v-if="authorityHandle(47)" class="top-btn" value="添加任务" @click.native="creatTaskDialog" />
      <!-- <k-button class="top-btn" value="玩法介绍" @click.native="ruleGuideDialog" /> -->
      <div class="top-right">
        <k-button class="top-right-btn" value="设置" @click.native="settingDialog" />

        <el-switch
          v-model="taskState"
          :disabled="!authorityHandle(47)"
          active-color="#3b425d"
          inactive-color="#E9EBF2"
          active-text="开启"
          inactive-text="关闭"
          :active-value="1"
          :inactive-value="0"
          @change="taskStateChange()"
        />
      </div>
    </div>

    <!--表格相关 -->
    <el-table
      :data="acivityTableData"
      fit
      border
      highlight-current-row
      style="width: 100%;border-radius:8px;"
      :header-cell-style="{background:'#F6F5FA',color:'#4E4F62'}"
    >
      <el-table-column width="80px" type="index" label="序号" align="center" />

      <el-table-column v-if="authorityHandle(47)" prop="taskSort" min-width="100px" label="排序" align="center">
        <editable-cell v-model="row.taskSort" slot-scope="{row}" :show-input="row.editMode" @keyup.enter.native="upTaskSort(row)">
          <span slot="content" style="text-align: center;display:block;width:100%;">{{ row.taskSort }}</span>
        </editable-cell>
      </el-table-column>

      <el-table-column v-else prop="taskSort" min-width="100px" label="排序" align="center" />

      <el-table-column prop="typeName" min-width="100px" label="任务类型" align="center" show-overflow-tooltip />
      <el-table-column prop="taskTitle" min-width="100px" label="任务标题" align="center" show-overflow-tooltip />
      <el-table-column min-width="100px" label="箱子/饰品" align="center">
        <template slot-scope="scope">
          {{ scope.row.partDataId === -1? '全选' : scope.row.dataName }}
        </template>
      </el-table-column>
      <el-table-column prop="partName" min-width="100px" label="参与方式" align="center" show-overflow-tooltip />
      <el-table-column prop="partNum" min-width="100px" label="参与门槛" align="center" show-overflow-tooltip />
      <el-table-column prop="taskPoint" min-width="100px" label="积分" align="center" show-overflow-tooltip />
      <el-table-column prop="cycleName" min-width="100px" label="任务周期" align="center" show-overflow-tooltip />
      <el-table-column min-width="150px" label="任务时间" align="center" show-overflow-tooltip>
        <template slot-scope="scope">
          <div v-if="scope.row.taskCycle===3">
            {{ scope.row.timeType === 1? scope.row.startTime+'-'+scope.row.endTime : '周'+scope.row.timeNum }}
          </div>
        </template>
      </el-table-column>
      <el-table-column prop="statusName" min-width="90px" label="任务状态" align="center" />
      <el-table-column min-width="100px" label="开关" align="center">
        <template slot-scope="scope">
          <el-switch
            v-model="scope.row.taskStatus"
            :disabled="!authorityHandle(47)"
            active-color="#3b425d"
            inactive-color="#E9EBF2"
            active-text="开"
            inactive-text="关"
            :active-value="1"
            :inactive-value="2"
            @change="updateTaskStatus($event,scope)"
          />
        </template>
      </el-table-column>
      <el-table-column min-width="200px" label="操作" align="center">
        <template slot-scope="scope">
          <div class="op-div">
            <k-button class="table-btn" value="查看/修改" @click.native="updateTaskDialog(scope.row)" />
            <k-button v-if="authorityHandle(47)" class="table-btn" value="删除" :disabled="scope.row.openStatus===1?true:false" @click.native="deleteTaskItem(scope.row.id)" />
            <k-button class="table-btn" value="领取详情" @click.native="openuserListDialog(scope.row)" />
          </div>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="totalRows > 0"
      :total="totalRows"
      :page.sync="listQuery.pager.pageNo"
      :limit.sync="listQuery.pager.pageSize"
      @pagination="loadData"
    />
    <!-- 玩法介绍 弹窗 -->
    <k-dialog
      :show-hide.sync="ruleGuide.showHide"
      :modal-append-to-body="false"
      :append-to-body="true"
      title="玩法介绍"
      class-name="ruleGuide-dialog"
      :show-foot="false"
      :two-btn="authorityHandle(47)"
      @click="guideSave"
    >
      <div class="dialog-ruleGuide" style="padding:30px">
        <el-form :model="ruleGuideContent" label-width="auto">
          <el-form-item label="内容介绍：" prop="content">
            <quill-editor
              ref="myQuillEditor"
              v-model.trim="ruleGuideContent.content"
              :options="editorOption"
              class="editer"
            />
          </el-form-item>
        </el-form>
      </div>
    </k-dialog>

    <!-- 添加任务 弹窗 -->
    <k-dialog
      :show-hide.sync="creatRollRoom.showHide"
      :modal-append-to-body="false"
      :append-to-body="true"
      :title="textMap[dialogStatus]"
      class-name="creatRollRoom_dialog"
      :show-foot="false"
      :two-btn="authorityHandle(47) && updateButtonState"
      :close-fun="handleCloseCreateRoom"
      @click="saveActivityRed"
    >
      <div class="dialog_creatRollRoom">
        <el-form ref="ruleForm" :model="taskModel" label-width="auto" :rules="redrules">
          <el-form-item label="任务类型：">
            <div class="chargeform">
              <el-select v-model="taskModel.taskType" :disabled="!authorityHandle(47)" clearable placeholder="请选择任务类型" class="red_money" @change="taskTypeChange">
                <el-option
                  v-for="item in taskTypeList"
                  :key="item.lineId"
                  :label="item.lineName"
                  :value="item.lineId"
                />
              </el-select>
            </div>
          </el-form-item>
          <el-form-item label="任务标题：">
            <el-input
              v-model="taskModel.taskTitle"
              :readonly="!authorityHandle(47)"
              type="textarea"
              :rows="3"
              show-word-limit
              placeholder="请输入"
            />
          </el-form-item>

          <el-form-item label="任务周期：">
            <div class="chargeform">
              <el-select v-model="taskModel.taskCycle" :disabled="!authorityHandle(47)" placeholder="请选择" clearable class="red_money">
                <el-option
                  v-for="item in cycleTypeList"
                  :key="item.lineId"
                  :label="item.lineName"
                  :value="item.lineId"
                />
              </el-select>
            </div>
          </el-form-item>
          <div v-show="taskModel.taskCycle===3">
            <el-form-item label="任务时间：">
              <el-date-picker
                v-model="timeCotinue"
                :readonly="!authorityHandle(47)"
                :disabled="taskModel.timeType === 2"
                type="datetimerange"
                value-format="yyyy-MM-dd HH:mm:ss"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                @change="datetimerange"
              />
              <el-radio-group v-model="taskModel.timeType" class="radio_group" :disabled="!authorityHandle(47) && radioState">
                <el-radio :label="1" />
              </el-radio-group>
            </el-form-item>
            <el-form-item label="">
              <el-select v-model="taskModel.timeNum" placeholder="请选择" class="red_money" :disabled="!authorityHandle(47) && taskModel.timeType === 1">
                <el-option label="周一" :value="1" />
                <el-option label="周二" :value="2" />
                <el-option label="周三" :value="3" />
                <el-option label="周四" :value="4" />
                <el-option label="周五" :value="5" />
                <el-option label="周六" :value="6" />
                <el-option label="周日" :value="7" />
              </el-select>
              <el-radio-group v-model="taskModel.timeType" class="radio_group" :disabled="!authorityHandle(47) && radioState">
                <el-radio :label="2" />
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-show="taskModel.taskType < 3" style="display:flex;">
            <el-form-item label="选择箱子/饰品：">
              <el-select
                v-model="taskModel.partDataId"
                :disabled="!authorityHandle(47) && checkAllBox"
                style="width: 100%;"
                filterable
                clearable
                placeholder="请选择"
              >
                <el-option
                  v-for="item in boxResultList"
                  :key="item.lineId"
                  :label="item.lineName"
                  :value="item.lineId"
                />
              </el-select>
              <p v-show="checkAllBox">已选择所有箱子/饰品</p>
            </el-form-item>
            <k-button v-if="authorityHandle(47)" class="balance_btn" :value="checkAllBox ? '取消':'所有箱子/饰品'" @click.native="checkAllBoxClick" />
          </div>
          <el-form-item label="参与方式：">
            <div class="chargeform">
              <el-select v-model="taskModel.partType" :disabled="!authorityHandle(47)" placeholder="请选择" clearable style="width:120px;margin-right:10px">
                <el-option
                  v-for="item in partTypeListByType"
                  :key="item.lineId"
                  :label="item.lineName"
                  :value="item.lineId"
                />
              </el-select>
              <el-input v-model="taskModel.partNum" :readonly="!authorityHandle(47)" onkeyup="value=value.replace(/[^0-9]/g,'')" placeholder="请输入数值" style="width:140px;" />

            </div>
          </el-form-item>
          <el-form-item label="积分金额：" prop="taskPoint">
            <el-input v-model="taskModel.taskPoint" :readonly="!authorityHandle(47)" class="red_money" onkeyup="value=value.replace(/[^0-9.]/g,'')" placeholder="请输入数值" />
          </el-form-item>

        </el-form>
      </div>
    </k-dialog>

    <!-- 设置 弹窗 -->
    <k-dialog
      :show-hide.sync="showSettingDialog"
      :modal-append-to-body="false"
      :append-to-body="true"
      class="setting_dialog"
      title="任务设置"
      :two-btn="authorityHandle(47)"
      @click="taskSettingSave"
    >

      <el-radio-group v-model="settingType" fill="#3b425d" text-color="#ffffff" class="top-radio-group">
        <el-radio-button label="setting1">积分比例设置</el-radio-button>
        <el-radio-button label="setting2">额外奖励设置</el-radio-button>
      </el-radio-group>
      <div class="dialog-warningSetting">
        <div v-if="settingType === 'setting1'" class="ration_div">
          <el-form label-width="80px">
            <el-form-item label="平台币=">
              <el-input v-model="coinModel" :readonly="!authorityHandle(47)" placeholder="请输入数值" />积分
            </el-form-item>
          </el-form>
        </div>
        <div v-if="settingType === 'setting2'" class="ration_div">
          <el-form label-width="200px">
            <el-form-item label="完成每日任务额外奖励：">
              <el-input v-model="dayTaskModel" :readonly="!authorityHandle(47)" placeholder="请输入数值" />积分
            </el-form-item>
          </el-form>
        </div>
      </div>
    </k-dialog>

    <!-- 参与人名单 -->
    <k-dialog
      :show-hide.sync="userListDialog.showHide"
      :modal-append-to-body="false"
      :append-to-body="true"
      title="参与人名单"
      class-name="creatRollRoom_dialog"
      :show-foot="false"
      :two-btn="false"
    >
      <div>
        <!--表格相关 -->
        <el-table
          :data="userList"
          fit
          border
          height="500"
          highlight-current-row
          style="width: 100%;border-radius:8px;"
          :header-cell-style="{background:'#F6F5FA',color:'#4E4F62'}"
        >
          <el-table-column width="80px" type="index" label="序号" align="center" />
          <el-table-column prop="userMobile" min-width="160px" label="参与人用户名" align="center" show-overflow-tooltip />
          <el-table-column prop="userName" min-width="120px" label="昵称" align="center" show-overflow-tooltip />
          <el-table-column prop="amount" min-width="120px" label="红包金额（积分）" align="center" show-overflow-tooltip />
          <el-table-column prop="receiveTime" min-width="150px" label="领取时间" align="center" show-overflow-tooltip />
        </el-table>
      </div>
    </k-dialog>
  </div>
</template>
<script>
import { listTaskData, getTaskTypeList, getPartTypeListByType, getPartTypeList, getCycleTypeList, getBoxList, getLuckyList, saveTaskData, updateTaskData, updateTaskSort, updateTaskStatus, deleteTaskData, getTaskDescribe, setTaskDescribe, getPointCurry, setPointCurry, getPointOtherAward, setPointOtherAward, getTaskStatus, setTaskStatus } from '@/api/task/index'
import Pagination from '@/components/Pagination'
import EditableCell from '@/components/EditableCell'

export default {
  components: { Pagination, EditableCell },
  data() {
    return {
      taskTypeList: [],
      partTypeList: [],
      partTypeListByType: [],
      cycleTypeList: [],
      boxResultList: [],
      checkAllBox: false,
      dayTaskModel: 0,
      coinModel: 0,
      taskState: 0,
      redrules: {
        taskPoint: [
          { required: true, message: '请输入积分金额', trigger: 'blur' }
        ]
      },
      giveType: 1,
      settingType: 'setting1',
      dialogStatus: 'create',
      textMap: {
        update: '修改任务',
        create: '创建任务'
      },
      updateButtonState: false,
      radioState: false,
      totalRows: 0, // 分页组件--数据总条数
      listQuery: {
        pager: {
          pageNo: 1,
          pageSize: 10,
          totalRows: '',
          start: ''
        },
        sort: '', // 排序字段 为对应列名,
        direction: '', // 排序 正向(asc)逆向(desc),
        taskType: undefined, // 任务类型
        partType: undefined, // 任务参与方式
        taskCycle: undefined, // 任务周期
        taskStatus: undefined, // 任务状态
        timeNum: undefined, // 周几
        startTime: undefined, // 饰品外观',
        endTime: undefined, // 饰品类别',
        key: '' // 箱子名称或关键词 箱子配置界面所用'
      },
      acivityTableData: [],
      winnerUserList: [],
      userList: [],
      ruleGuideContent: {
        content: ''
      },
      editorOption: { //  富文本编辑器配置
        placeholder: '请输入内容',
        modules: {
          toolbar: [
            ['bold', 'italic', 'underline', 'strike'], // 加粗，斜体，下划线，删除线
            ['blockquote', 'code-block'], // 引用，代码块
            [{ 'header': 1 }, { 'header': 2 }], // 标题，键值对的形式；1、2表示字体大小
            [{ 'list': 'ordered' }, { 'list': 'bullet' }], // 列表
            [{ 'script': 'sub' }, { 'script': 'super' }], // 上下标
            [{ 'indent': '-1' }, { 'indent': '+1' }], // 缩进
            [{ 'direction': 'rtl' }], // 文本方向
            [{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小
            [{ 'header': [1, 2, 3, 4, 5, 6, false] }], // 几级标题
            [{ 'color': [] }, { 'background': [] }], // 字体颜色，字体背景颜色
            [{ 'font': [] }], // 字体
            [{ 'align': [] }], // 对齐方式
            ['clean'], // 清除字体样式
            ['image'] // 上传图片、上传视频
          ]
        }
      },
      taskModel: {
        id: null,
        taskType: undefined, // 任务类型',
        taskTitle: undefined, // 任务标题',
        taskCycle: undefined, // 任务周期',
        startTime: undefined, // 任务开始时间',
        endTime: undefined, // 任务结束时间',
        partType: undefined, // 任务参与方式',
        partNum: undefined, // 参与的具体数额',
        partDataId: undefined, // 选中的箱子或饰品',
        taskPoint: undefined, // 积分金额',
        taskStatus: undefined, // 任务状态',
        taskSort: undefined, // 任务排序',
        timeType: 1, // 任务时间模式 1时间间隔|2每周几',
        timeNum: undefined // 周几'
      },
      timeValue: '',
      timeCotinue: '',
      conditions: {
        keyword: null
      },
      creatRollRoom: {
        showHide: false
      },
      userListDialog: {
        showHide: false
      },
      ruleGuide: {
        showHide: false
      },
      addRobots: {
        showHide: false
      },
      updateBabyNum: {
        showHide: false
      },
      showSettingDialog: false,
      amount: 0
    }
  },
  watch: {
    // 时间赋值
    timeValue(val) {
      this.listQuery.startTime = this.timeValue ? this.timeValue[0] : null
      this.listQuery.endTime = this.timeValue ? this.timeValue[1] : null
    }
  },
  created() {
    this.loadData()
    this.getTaskTypeList()
    this.getPartTypeList()
    this.getCycleTypeList()
    this.getTaskDescribe()
    this.getTaskStatus()
  },
  methods: {
    // 房间排序
    upTaskSort(row) {
      const obj = { 'sort': row.taskSort, 'id': row.id }
      updateTaskSort(obj).then(res => {
        if (!res.data.success) {
          this.$message.error(res.data.msg)
          row.taskSort = ''
        }
        this.$log(res)
      })
    },
    getTaskStatus() {
      getTaskStatus().then(res => {
        this.taskState = res.data ? 1 : 0
      })
    },
    // 选择所有 箱子 饰品
    checkAllBoxClick() {
      this.checkAllBox = !this.checkAllBox
      this.taskModel.partDataId = undefined
    },
    taskTypeChange(v, flag) {
      this.$log(v, flag)
      getPartTypeListByType({ 'taskType': v }).then(res => {
        this.partTypeListByType = res.data
      })
      if (v > 3) return
      if (!flag) {
        this.checkAllBox = false
        this.taskModel.partDataId = undefined
      }
      if (v === 1) {
        getBoxList().then(res => {
          this.boxResultList = res.data
        })
      } else if (v === 2) {
        getLuckyList().then(res => {
          this.boxResultList = res.data
        })
      }
    },
    getTaskTypeList() {
      getTaskTypeList().then(res => {
        this.taskTypeList = res.data
      })
    },
    getPartTypeList() {
      getPartTypeList().then(res => {
        this.partTypeList = res.data
      })
    },
    getCycleTypeList() {
      getCycleTypeList().then(res => {
        this.cycleTypeList = res.data
      })
    },
    settingDialog() {
      getPointCurry().then(res => {
        this.showSettingDialog = true
        this.coinModel = res.data
      })
      getPointOtherAward().then(res => {
        this.dayTaskModel = res.data
      })
    },
    taskSettingSave() {
      if (this.settingType === 'setting1') {
        setPointCurry({ 'data': this.coinModel }).then(res => {
          this.$message.success('保存成功')
          this.showSettingDialog = false
        })
      } else {
        setPointOtherAward({ 'data': this.dayTaskModel }).then(res => {
          this.$message.success('保存成功')
          this.showSettingDialog = false
        })
      }
    },
    loadData() {
      listTaskData(this.listQuery).then(res => {
        this.totalRows = res.data.totalRows
        this.amount = res.data.totalData
        this.acivityTableData = res.data.rows.map(row => {
          return {
            ...row,
            editMode: false
          }
        })
      })
    },

    // 肉房持续时间区间选择
    datetimerange(timeValue) {
      this.taskModel.startTime = this.timeCotinue ? timeValue[0] : null
      this.taskModel.endTime = this.timeCotinue ? timeValue[1] : null
    },
    deleteTaskItem(id) {
      this.$confirm('确定删除么?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        deleteTaskData({ id }).then(res => {
          if (res.data.success) {
            this.$message.success('删除成功')
            this.loadData()
          } else {
            this.$message.success(res.data.msg)
          }
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消'
        })
      })
    },
    // 保存玩法管理
    guideSave() {
      const contents = this.ruleGuideContent.content
      setTaskDescribe({ 'data': contents }).then(res => {
        this.ruleGuide.showHide = false
      })
    },
    // 加载玩法管理
    getTaskDescribe() {
      getTaskDescribe().then(res => {
        this.ruleGuideContent.content = res.data
      })
    },
    handleCloseCreateRoom() {
      this.$refs.ruleForm.resetFields()
    },
    saveActivityRed() {
      this.$refs.ruleForm.validate((valid) => {
        if (valid) {
          if (this.dialogStatus === 'create') {
            if (this.checkAllBox) {
              this.taskModel.partDataId = -1
            }
            saveTaskData(this.taskModel).then(res => {
              if (res.data.success) {
                this.$message.success('保存成功')
                this.$resetForm(this.taskModel)
                this.loadData()
              } else {
                this.$message.success(res.data.msg)
              }
            })
          } else {
            if (this.checkAllBox) {
              this.taskModel.partDataId = -1
            }
            updateTaskData(this.taskModel).then(res => {
              if (res.data.success) {
                this.$message.success('修改成功')
                this.$resetForm(this.taskModel)
                this.loadData()
              } else {
                this.$message.success(res.data.msg)
              }
            })
          }
          this.creatRollRoom.showHide = false
        }
      })
    },
    creatTaskDialog() {
      this.$resetForm(this.taskModel)
      this.taskModel.timeType = 1
      this.timeCotinue = ''
      this.winnerUserList = []
      this.dialogStatus = 'create'
      this.creatRollRoom.showHide = true
      this.updateButtonState = true
      // this.radioState = false
    },
    updateTaskDialog(row) {
      this.dialogStatus = 'update'
      this.checkAllBox = row.partDataId === -1
      this.creatRollRoom.showHide = true
      this.taskModel.id = row.id
      this.taskModel.taskType = row.taskType
      this.taskModel.taskTitle = row.taskTitle
      this.taskModel.taskCycle = row.taskCycle
      this.taskModel.partType = row.partType
      this.taskModel.partNum = row.partNum
      this.taskModel.partDataId = row.partDataId
      this.taskModel.taskPoint = row.taskPoint
      this.taskModel.taskStatus = row.taskStatus
      this.taskModel.taskSort = row.taskSort
      this.taskModel.timeType = row.timeType
      this.taskModel.timeNum = row.timeNum
      this.timeCotinue = [row.startTime === null ? '' : row.startTime, row.endTime === null ? '' : row.endTime]
      this.updateButtonState = true
      this.taskTypeChange(this.taskModel.taskType, 1)
      // this.updateButtonState = (row.envelopeNum - row.surplusNum) === 0
      // this.radioState = !this.updateButtonState
      // this.taskModel.timeType = row.timeType
      // this.radioChange(this.taskModel.timeType)
    },
    openuserListDialog(row) {
      this.$router.push({ name: 'PlayerPointChange', params: { taskType: row.taskType, taskTitle: row.taskTitle }})
    },
    // 任务状态
    updateTaskStatus(event, scope) {
      updateTaskStatus({ 'id': scope.row.id }).then(res => {
        if (res.data.success) {
          this.$message.success('操作成功')
        } else {
          this.$message.success(res.data.msg)
        }
      })
    },
    // 任务状态
    taskStateChange() {
      setTaskStatus({ 'data': this.taskState === 1 }).then(res => {
        this.$message.success('操作成功')
      })
    },

    // 搜索查询事件
    handleFilter() {
      this.listQuery.pager.pageNo = 1
      this.loadData()
    },

    ruleGuideDialog() {
      this.ruleGuide.showHide = true
    }
  }

}
</script>
<style lang="scss" scoped>
$menuText:#14162E; // 侧边栏字体颜色
$hoverColor:#1D143C;// 鼠标停留主色调浅色
$mainColor:#3b425d;// 主色调
::v-deep .el-radio__label{
  display: none;
}
.span_cloum{
  &.active{
    color: #3b425d;
  }
}
.balance_btn{
  margin-left: 20px;
  font-size: 14px;
  height: 40px;
  color: #ffffff;
}
.filter-container {
  width: 100%;
  height: 48px;
  line-height: 48px;
  display: flex;
  flex-direction: row;
  align-items: center;
  .filter-item {
    &.weekselect{
      margin-left: 20px;
      margin-top: 5px;
    }
  }
  .kInput{
    position:absolute;
    right: 20px;
  }
  .filter-title{
    height: 48px;
    line-height: 48px;
    font-size: 16px;
    font-weight: 500;
    margin-right: 22px;
    color: #14162E;
  }
  .user-status{
    margin-right: 20px;
  }
  ::v-deep .el-range-editor.el-input__inner {
    width: 250px;
  }
  ::v-deep .kSelect .el-select .el-input .el-input__inner {
    width: 150px;
  }
}
.op_container{
  position: relative;
  .top-btn{
    margin: 30px 0px 30px 0px;
    font-size: 14px;
    color: #ffffff;
    &:nth-of-type(2){
      margin-left: 10px;
    }
  }
  .top-right{
    position: absolute;
    right: 20px;
    top: 30px;
    .top-right-btn{
      margin-right: 20px;
      background-color: #F8F7FB;
      border-color: transparent;
      color: #14162E;
      &:hover{
        color: #ffffff;
        background-color: $mainColor;
      }
      &:active{
        color: #14162E;
      }
    }
  }
}
.red_money_small{
  width: 100px;
}
.radio_group{
  margin-left: 30px;
}
.red_money{
  width: 200px;
}
.grid-div{
  display: grid;
  grid-template-columns:  repeat(7, 120px);
  .item{
    height: 50px;
    font-size: 14px;
    line-height:50px;
    text-align: center;
    border: 1px solid #E3E2E7;
    width: 120px;
    overflow: hidden;
    display: inline-block;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 10px;
  }
}

.kSelect .el-select .el-input .el-input__inner{
  width: 124px;
}
::v-deep .el-select .el-input.is-focus .el-input__inner {
    border-color: $mainColor;
}
::v-deep .el-input__inner:focus {
    border-color: $mainColor;
}
.el-form-item__label-wrap .el-form-item__label{
  float: none;
}

.dialog_creatRollRoom{
  display: flex;
  flex-direction: row;
  justify-content: center;
  margin: 40px 80px;
  ::v-deep .el-select .el-select__tags>span {
			display: none;
	}
  .el-tag + .el-tag {
    margin-left: 10px;
  }
   .el-tag {
    color: $mainColor;
    background-color: #ffffff;
    border-color: $mainColor;
    ::v-deep .el-tag__close {
      color: $mainColor;
    }
    ::v-deep .el-icon-close:hover {
      color:#ffffff;
      background: $mainColor;
    }
  }
}

.editer {
  width: 500px;
  border-radius: 8px;
  float: left;
  box-sizing: border-box;
  color: #606266;
  ::v-deep .ql-container {
    height: 270px;
    border-radius: 0px 0px 8px 8px;
  }
  ::v-deep .ql-toolbar.ql-snow {
    border-radius: 8px 8px 0px 0px;
  }
}
.chargeform{
  display: flex;
  flex-direction: row;
}

::v-deep .el-switch__label.is-active {
    color: $mainColor;
}

.addBox_dialog{
  display: flex;
  flex-direction: column;
  justify-content: center;
  ::v-deep .el-dialog__body{
    width: 678px;
    margin: 40px 80px;
 }
::v-deep .el-select .el-select__tags>span {
			display: none;
	}
  .el-tag + .el-tag {
    margin-left: 10px;
  }
   .el-tag {
    color: $mainColor;
    background-color: #ffffff;
    border-color: $mainColor;
    ::v-deep .el-tag__close {
      color: $mainColor;
    }
    ::v-deep .el-icon-close:hover {
      color:#ffffff;
      background: $mainColor;
    }
  }
}
.setting_dialog{
 ::v-deep .el-dialog__body{
    width: 600px;
  }
   .ration_div{
     display: flex;
     justify-content: center;
  }
  ::v-deep .el-radio-button__inner{
    &:hover{
      color: $mainColor;
    }
  }
  .dialog-warningSetting{
    padding-top: 30px;
    ::v-deep.el-input{
      width: 110px;
    }
  }
}
</style>
